import 'package:flutter/material.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';

class ToastUtils {
  static void showToast(String msg, BuildContext context) {
    if (msg != null) {
      //Customize toast content widget, no global configuration
      showToastWidget(
        Center(
          child:Container(
            padding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 5),
            margin: EdgeInsets.symmetric(horizontal: 50.0),
            decoration: ShapeDecoration(
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(5.0),
                ),
                color: Colors.black
            ),
            child: Text(
              'Jump to new page',
              style: TextStyle(
                color: Colors.white,
              ),
            ),
          ) ,
        ),

        context: context,
        isIgnoring: false,
        duration: Duration(seconds: 2),
      );
    }
  }
}
